package com.rdxer.repository;

import com.rdxer.model.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author lxf
 */
public interface AccountRepository extends JpaRepository<Account, String>,JpaSpecificationExecutor<Account> {
    /**
     * 根据用户名查找 用户
     * @param username 用户名称
     * @return 用户
     */
    Account findAccountByUsername(String username);

    Account findAccountByTel(String phone);

    Account findAccountByEmail(String email);

    List<Account> findAccountsByUsernameOrTelOrEmail(String username,String phone,String email);

    List<Account> findByUsernameOrId(String v1, String v2);
}
